
_BMA180_init:

;lib_bma180.c,7 :: 		void BMA180_init() {
;lib_bma180.c,11 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_bma180.c,12 :: 		I2C1_Wr(BMA180_WRITE_ADDR);      // Write mode
	MOVLW       128
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,13 :: 		I2C1_Wr(0x0D);
	MOVLW       13
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,14 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_bma180.c,15 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_bma180.c,16 :: 		I2C1_Wr(BMA180_READ_ADDR);       // Read Mode
	MOVLW       129
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,17 :: 		temp = I2C1_Rd(0);
	CLRF        FARG_I2C1_Rd_ack+0 
	CALL        _I2C1_Rd+0, 0
	MOVF        R0, 0 
	MOVWF       BMA180_init_temp_L0+0 
;lib_bma180.c,18 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_bma180.c,19 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_bma180.c,20 :: 		I2C1_Wr(BMA180_WRITE_ADDR);      // Write mode
	MOVLW       128
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,21 :: 		I2C1_Wr(0x0D);
	MOVLW       13
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,22 :: 		I2C1_Wr(temp | 0x10);
	MOVLW       16
	IORWF       BMA180_init_temp_L0+0, 0 
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,23 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_bma180.c,24 :: 		Delay_ms(50);
	MOVLW       4
	MOVWF       R11, 0
	MOVLW       12
	MOVWF       R12, 0
	MOVLW       51
	MOVWF       R13, 0
L_BMA180_init0:
	DECFSZ      R13, 1, 1
	BRA         L_BMA180_init0
	DECFSZ      R12, 1, 1
	BRA         L_BMA180_init0
	DECFSZ      R11, 1, 1
	BRA         L_BMA180_init0
	NOP
	NOP
;lib_bma180.c,27 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_bma180.c,28 :: 		I2C1_Wr(BMA180_WRITE_ADDR);      // Write mode
	MOVLW       128
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,29 :: 		I2C1_Wr(0x50);
	MOVLW       80
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,30 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_bma180.c,31 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_bma180.c,32 :: 		I2C1_Wr(BMA180_READ_ADDR);       // Read Mode
	MOVLW       129
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,33 :: 		temp = I2C1_Rd(0);
	CLRF        FARG_I2C1_Rd_ack+0 
	CALL        _I2C1_Rd+0, 0
	MOVF        R0, 0 
	MOVWF       BMA180_init_temp_L0+0 
;lib_bma180.c,34 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_bma180.c,35 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_bma180.c,36 :: 		I2C1_Wr(BMA180_WRITE_ADDR);      // Write mode
	MOVLW       128
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,37 :: 		I2C1_Wr(0x50);
	MOVLW       80
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,38 :: 		I2C1_Wr((temp & 0xF8) | 0x01);
	MOVLW       248
	ANDWF       BMA180_init_temp_L0+0, 0 
	MOVWF       FARG_I2C1_Wr_data_+0 
	BSF         FARG_I2C1_Wr_data_+0, 0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,39 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_bma180.c,40 :: 		Delay_ms(10);
	MOVLW       156
	MOVWF       R12, 0
	MOVLW       215
	MOVWF       R13, 0
L_BMA180_init1:
	DECFSZ      R13, 1, 1
	BRA         L_BMA180_init1
	DECFSZ      R12, 1, 1
	BRA         L_BMA180_init1
;lib_bma180.c,43 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_bma180.c,44 :: 		I2C1_Wr(BMA180_WRITE_ADDR);      // Write mode
	MOVLW       128
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,45 :: 		I2C1_Wr(0x20);
	MOVLW       32
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,46 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_bma180.c,47 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_bma180.c,48 :: 		I2C1_Wr(BMA180_READ_ADDR);       // Read Mode
	MOVLW       129
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,49 :: 		temp = I2C1_Rd(0);
	CLRF        FARG_I2C1_Rd_ack+0 
	CALL        _I2C1_Rd+0, 0
	MOVF        R0, 0 
	MOVWF       BMA180_init_temp_L0+0 
;lib_bma180.c,50 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_bma180.c,51 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_bma180.c,52 :: 		I2C1_Wr(BMA180_WRITE_ADDR);      // Write mode
	MOVLW       128
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,53 :: 		I2C1_Wr(0x20);
	MOVLW       32
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,54 :: 		I2C1_Wr(temp & 0x0F);
	MOVLW       15
	ANDWF       BMA180_init_temp_L0+0, 0 
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,55 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_bma180.c,56 :: 		Delay_ms(10);
	MOVLW       156
	MOVWF       R12, 0
	MOVLW       215
	MOVWF       R13, 0
L_BMA180_init2:
	DECFSZ      R13, 1, 1
	BRA         L_BMA180_init2
	DECFSZ      R12, 1, 1
	BRA         L_BMA180_init2
;lib_bma180.c,59 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_bma180.c,60 :: 		I2C1_Wr(BMA180_WRITE_ADDR);      // Write mode
	MOVLW       128
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,61 :: 		I2C1_Wr(0x35);
	MOVLW       53
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,62 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_bma180.c,63 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_bma180.c,64 :: 		I2C1_Wr(BMA180_READ_ADDR);       // Read Mode
	MOVLW       129
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,65 :: 		temp = I2C1_Rd(0);
	CLRF        FARG_I2C1_Rd_ack+0 
	CALL        _I2C1_Rd+0, 0
	MOVF        R0, 0 
	MOVWF       BMA180_init_temp_L0+0 
;lib_bma180.c,66 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_bma180.c,67 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_bma180.c,68 :: 		I2C1_Wr(BMA180_WRITE_ADDR);      // Write mode
	MOVLW       128
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,69 :: 		I2C1_Wr(0x35);
	MOVLW       53
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,70 :: 		I2C1_Wr(((temp & 0xF0) | 0x04));
	MOVLW       240
	ANDWF       BMA180_init_temp_L0+0, 0 
	MOVWF       FARG_I2C1_Wr_data_+0 
	BSF         FARG_I2C1_Wr_data_+0, 2 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,71 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_bma180.c,72 :: 		Delay_ms(10);
	MOVLW       156
	MOVWF       R12, 0
	MOVLW       215
	MOVWF       R13, 0
L_BMA180_init3:
	DECFSZ      R13, 1, 1
	BRA         L_BMA180_init3
	DECFSZ      R12, 1, 1
	BRA         L_BMA180_init3
;lib_bma180.c,73 :: 		}
	RETURN      0
; end of _BMA180_init

_BMA180_readAcc:

;lib_bma180.c,75 :: 		void BMA180_readAcc(float *acc) {
;lib_bma180.c,80 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_bma180.c,81 :: 		I2C1_Wr(BMA180_WRITE_ADDR);      // Write mode
	MOVLW       128
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,82 :: 		I2C1_Wr(0x02);
	MOVLW       2
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,83 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_bma180.c,84 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_bma180.c,85 :: 		I2C1_Wr(BMA180_READ_ADDR);       // Read Mode
	MOVLW       129
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_bma180.c,86 :: 		for (cnt=0; cnt<6; cnt++) {
	CLRF        BMA180_readAcc_cnt_L0+0 
L_BMA180_readAcc4:
	MOVLW       6
	SUBWF       BMA180_readAcc_cnt_L0+0, 0 
	BTFSC       STATUS+0, 0 
	GOTO        L_BMA180_readAcc5
;lib_bma180.c,88 :: 		ack = (cnt<5);
	MOVLW       5
	SUBWF       BMA180_readAcc_cnt_L0+0, 0 
	MOVLW       1
	BTFSC       STATUS+0, 0 
	MOVLW       0
	MOVWF       FARG_I2C1_Rd_ack+0 
;lib_bma180.c,89 :: 		acc_read[cnt] = I2C1_Rd(ack);
	MOVLW       BMA180_readAcc_acc_read_L0+0
	MOVWF       FLOC__BMA180_readAcc+0 
	MOVLW       hi_addr(BMA180_readAcc_acc_read_L0+0)
	MOVWF       FLOC__BMA180_readAcc+1 
	MOVF        BMA180_readAcc_cnt_L0+0, 0 
	ADDWF       FLOC__BMA180_readAcc+0, 1 
	BTFSC       STATUS+0, 0 
	INCF        FLOC__BMA180_readAcc+1, 1 
	CALL        _I2C1_Rd+0, 0
	MOVFF       FLOC__BMA180_readAcc+0, FSR1L
	MOVFF       FLOC__BMA180_readAcc+1, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
;lib_bma180.c,86 :: 		for (cnt=0; cnt<6; cnt++) {
	INCF        BMA180_readAcc_cnt_L0+0, 1 
;lib_bma180.c,90 :: 		}
	GOTO        L_BMA180_readAcc4
L_BMA180_readAcc5:
;lib_bma180.c,91 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_bma180.c,93 :: 		acc_int[0] = acc_read[1];
	MOVF        BMA180_readAcc_acc_read_L0+1, 0 
	MOVWF       BMA180_readAcc_acc_int_L0+0 
	MOVLW       0
	MOVWF       BMA180_readAcc_acc_int_L0+1 
;lib_bma180.c,94 :: 		acc_int[0] = acc_int[0] << 8;
	MOVF        BMA180_readAcc_acc_int_L0+0, 0 
	MOVWF       BMA180_readAcc_acc_int_L0+1 
	CLRF        BMA180_readAcc_acc_int_L0+0 
;lib_bma180.c,95 :: 		acc_int[0] |= acc_read[0];
	MOVF        BMA180_readAcc_acc_read_L0+0, 0 
	IORWF       BMA180_readAcc_acc_int_L0+0, 1 
	MOVLW       0
	IORWF       BMA180_readAcc_acc_int_L0+1, 1 
;lib_bma180.c,96 :: 		acc_int[0] = acc_int[0] >> 2;
	RRCF        BMA180_readAcc_acc_int_L0+1, 1 
	RRCF        BMA180_readAcc_acc_int_L0+0, 1 
	BCF         BMA180_readAcc_acc_int_L0+1, 7 
	BTFSC       BMA180_readAcc_acc_int_L0+1, 6 
	BSF         BMA180_readAcc_acc_int_L0+1, 7 
	RRCF        BMA180_readAcc_acc_int_L0+1, 1 
	RRCF        BMA180_readAcc_acc_int_L0+0, 1 
	BCF         BMA180_readAcc_acc_int_L0+1, 7 
	BTFSC       BMA180_readAcc_acc_int_L0+1, 6 
	BSF         BMA180_readAcc_acc_int_L0+1, 7 
;lib_bma180.c,97 :: 		acc_int[1] = acc_read[3];
	MOVF        BMA180_readAcc_acc_read_L0+3, 0 
	MOVWF       BMA180_readAcc_acc_int_L0+2 
	MOVLW       0
	MOVWF       BMA180_readAcc_acc_int_L0+3 
;lib_bma180.c,98 :: 		acc_int[1] = acc_int[1] << 8;
	MOVF        BMA180_readAcc_acc_int_L0+2, 0 
	MOVWF       BMA180_readAcc_acc_int_L0+3 
	CLRF        BMA180_readAcc_acc_int_L0+2 
;lib_bma180.c,99 :: 		acc_int[1] |= acc_read[2];
	MOVF        BMA180_readAcc_acc_read_L0+2, 0 
	IORWF       BMA180_readAcc_acc_int_L0+2, 1 
	MOVLW       0
	IORWF       BMA180_readAcc_acc_int_L0+3, 1 
;lib_bma180.c,100 :: 		acc_int[1] = acc_int[1] >> 2;
	RRCF        BMA180_readAcc_acc_int_L0+3, 1 
	RRCF        BMA180_readAcc_acc_int_L0+2, 1 
	BCF         BMA180_readAcc_acc_int_L0+3, 7 
	BTFSC       BMA180_readAcc_acc_int_L0+3, 6 
	BSF         BMA180_readAcc_acc_int_L0+3, 7 
	RRCF        BMA180_readAcc_acc_int_L0+3, 1 
	RRCF        BMA180_readAcc_acc_int_L0+2, 1 
	BCF         BMA180_readAcc_acc_int_L0+3, 7 
	BTFSC       BMA180_readAcc_acc_int_L0+3, 6 
	BSF         BMA180_readAcc_acc_int_L0+3, 7 
;lib_bma180.c,101 :: 		acc_int[2] = acc_read[5];
	MOVF        BMA180_readAcc_acc_read_L0+5, 0 
	MOVWF       BMA180_readAcc_acc_int_L0+4 
	MOVLW       0
	MOVWF       BMA180_readAcc_acc_int_L0+5 
;lib_bma180.c,102 :: 		acc_int[2] = acc_int[2] << 8;
	MOVF        BMA180_readAcc_acc_int_L0+4, 0 
	MOVWF       BMA180_readAcc_acc_int_L0+5 
	CLRF        BMA180_readAcc_acc_int_L0+4 
;lib_bma180.c,103 :: 		acc_int[2] |= acc_read[4];
	MOVF        BMA180_readAcc_acc_read_L0+4, 0 
	IORWF       BMA180_readAcc_acc_int_L0+4, 1 
	MOVLW       0
	IORWF       BMA180_readAcc_acc_int_L0+5, 1 
;lib_bma180.c,104 :: 		acc_int[2] = acc_int[2] >> 2;
	RRCF        BMA180_readAcc_acc_int_L0+5, 1 
	RRCF        BMA180_readAcc_acc_int_L0+4, 1 
	BCF         BMA180_readAcc_acc_int_L0+5, 7 
	BTFSC       BMA180_readAcc_acc_int_L0+5, 6 
	BSF         BMA180_readAcc_acc_int_L0+5, 7 
	RRCF        BMA180_readAcc_acc_int_L0+5, 1 
	RRCF        BMA180_readAcc_acc_int_L0+4, 1 
	BCF         BMA180_readAcc_acc_int_L0+5, 7 
	BTFSC       BMA180_readAcc_acc_int_L0+5, 6 
	BSF         BMA180_readAcc_acc_int_L0+5, 7 
;lib_bma180.c,106 :: 		acc[0] = (float)(acc_int[0] / 4096.0);
	MOVF        FARG_BMA180_readAcc_acc+0, 0 
	MOVWF       FLOC__BMA180_readAcc+0 
	MOVF        FARG_BMA180_readAcc_acc+1, 0 
	MOVWF       FLOC__BMA180_readAcc+1 
	MOVF        BMA180_readAcc_acc_int_L0+0, 0 
	MOVWF       R0 
	MOVF        BMA180_readAcc_acc_int_L0+1, 0 
	MOVWF       R1 
	CALL        _Int2Double+0, 0
	MOVLW       0
	MOVWF       R4 
	MOVLW       0
	MOVWF       R5 
	MOVLW       0
	MOVWF       R6 
	MOVLW       139
	MOVWF       R7 
	CALL        _Div_32x32_FP+0, 0
	MOVFF       FLOC__BMA180_readAcc+0, FSR1L
	MOVFF       FLOC__BMA180_readAcc+1, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
	MOVF        R1, 0 
	MOVWF       POSTINC1+0 
	MOVF        R2, 0 
	MOVWF       POSTINC1+0 
	MOVF        R3, 0 
	MOVWF       POSTINC1+0 
;lib_bma180.c,107 :: 		acc[1] = (float)(acc_int[1] / 4096.0);
	MOVLW       4
	ADDWF       FARG_BMA180_readAcc_acc+0, 0 
	MOVWF       FLOC__BMA180_readAcc+0 
	MOVLW       0
	ADDWFC      FARG_BMA180_readAcc_acc+1, 0 
	MOVWF       FLOC__BMA180_readAcc+1 
	MOVF        BMA180_readAcc_acc_int_L0+2, 0 
	MOVWF       R0 
	MOVF        BMA180_readAcc_acc_int_L0+3, 0 
	MOVWF       R1 
	CALL        _Int2Double+0, 0
	MOVLW       0
	MOVWF       R4 
	MOVLW       0
	MOVWF       R5 
	MOVLW       0
	MOVWF       R6 
	MOVLW       139
	MOVWF       R7 
	CALL        _Div_32x32_FP+0, 0
	MOVFF       FLOC__BMA180_readAcc+0, FSR1L
	MOVFF       FLOC__BMA180_readAcc+1, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
	MOVF        R1, 0 
	MOVWF       POSTINC1+0 
	MOVF        R2, 0 
	MOVWF       POSTINC1+0 
	MOVF        R3, 0 
	MOVWF       POSTINC1+0 
;lib_bma180.c,108 :: 		acc[2] = (float)(acc_int[2] / 4096.0);
	MOVLW       8
	ADDWF       FARG_BMA180_readAcc_acc+0, 0 
	MOVWF       FLOC__BMA180_readAcc+0 
	MOVLW       0
	ADDWFC      FARG_BMA180_readAcc_acc+1, 0 
	MOVWF       FLOC__BMA180_readAcc+1 
	MOVF        BMA180_readAcc_acc_int_L0+4, 0 
	MOVWF       R0 
	MOVF        BMA180_readAcc_acc_int_L0+5, 0 
	MOVWF       R1 
	CALL        _Int2Double+0, 0
	MOVLW       0
	MOVWF       R4 
	MOVLW       0
	MOVWF       R5 
	MOVLW       0
	MOVWF       R6 
	MOVLW       139
	MOVWF       R7 
	CALL        _Div_32x32_FP+0, 0
	MOVFF       FLOC__BMA180_readAcc+0, FSR1L
	MOVFF       FLOC__BMA180_readAcc+1, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
	MOVF        R1, 0 
	MOVWF       POSTINC1+0 
	MOVF        R2, 0 
	MOVWF       POSTINC1+0 
	MOVF        R3, 0 
	MOVWF       POSTINC1+0 
;lib_bma180.c,109 :: 		}
	RETURN      0
; end of _BMA180_readAcc
